package spring.demo.mapper;

import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import spring.demo.entity.Student;

@Mapper
public interface StudentMapper {

    @Select("SELECT * FROM STUDENT WHERE SNO = #{id}")
    Student findUserById(@Param("id") String id);

    @Select("SELECT * FROM STUDENT WHERE CLASS = #{className}")
    List<Student> findUserByClass(@Param("className") String className);

    @Select("SELECT * FROM STUDENT where SSEX = '男'")
    List<Student> listAll();

    @Select("SELECT * FROM STUDENT WHERE SNAME = #{name}")
    List<Student> findUserByName(@Param("name") String name);
}
